import socket
import cPickle as pickle

def connecter():
	sock = socket.socket()
	sock.connect((socket.gethostname(),12345))
	return sock
def getdata():
	sock=connecter()
	sock.send("webby")
	FILE = sock.makefile()
	data = pickle.load(FILE)
	FILE.close()
	return data

def display():
	data = getdata()
	print "<h1>Welcome!</h1>"
	for key in data.keys():
		print "<div id=\"nmea\"><div id=\"{0}\"><h3>{0}</h3>".format(key)
		for value in sorted(data[key].iterkeys()):
			print value,": ", data[key][value],"<br />"

		print "</div></div>"

display()
